package com.smh.demo1.a07;

import com.smh.demo1.common.LogColour;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;

import javax.annotation.PostConstruct;

/**
 * @author shiminghui
 * @date 2025/4/12 11:04
 * @description: TODO
 */

public class Bean1 implements InitializingBean {
    private static final Logger log = LoggerFactory.getLogger(Bean1.class);

    public void init() {
        log.info(LogColour.Blue("使用@bean注解的回调方法初始化"));
    }

    @PostConstruct
    public void postConstruct() {
        log.info(LogColour.Blue("使用@PostConstruct注解的回调方法初始化"));
    }


    @Override
    public void afterPropertiesSet() throws Exception {
        log.info(LogColour.Blue("使用InitializingBean接口的回调方法初始化"));
    }
}
